home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / obtsess.c < prev    next >
C/C++ Source or Header  |  1996-07-10  |  4KB  |  119 lines

  1.  /**********************************************************
  2.  *                                                         *
  3.  *                 OBTAIN_SESSION_PROC                     *
  4.  *                      (OBTSESS)                          *
  5.  *                                                         *
  6.  *  Handles the acqusition of a session for use by         *
  7.  *  the conversation.                                      *
  8.  *                                                         *
  9.  * INPUT : indicator of ATTACH/NO_ATTACH, pointer to RCB.  *
  10.  *                                                         *
  11.  * OUTPUT: GET_SESSION is sent to RM.                      *
  12.  *                                                         *
  13.  *                                                         *
  14.  * CopyRight 1995. Nicholas Poljakov all rights reserved.  *
  15.  *                                                         *
  16.  **********************************************************/
  17. #include <stdio.h>
  18. #include <state1.h>
  19. #include <session.h>
  20. #include <rcb.h>
  21. #include <tcb.h>
  22. #include <sparm.h>
  23. #include <string.h>
  24.  
  25. int sk_r_wt(void *);
  26. int SendBlock(void *, void *);
  27. int setrc(void *, void *);
  28. int sendhsf(void *);
  29. int sendhs(void *);
  30. int sendbm(void *, void *);
  31. int sendat(void *);
  32. int rtsend(void *);
  33. unsigned long rmfmh5(void *, void *);
  34. int recwait(void *);
  35. int rcvru(void *, void *);
  36. int rcvhs(void *, void *, void *, void *);
  37. int ralloc(void *, void *);
  38. int psrm(int, void *, void *);
  39. int ps_conv(int, void *);
  40. int proterr(void *, unsigned long);
  41. int preptrcv(void *, void *);
  42. int post_rcb(void *);
  43. struct repass *postopen(void *);
  44. int phsrec(void *);
  45. int pfmh5(void *);
  46. int opndst(void *);
  47. int Lrf_handler(void *);
  48. int get_sess(void *, void *);
  49. int get_attr(void *);
  50. int fsm_error(unsigned char, void *);
  51. int fsm_conv(unsigned char, unsigned char, void *);
  52. int flush (void *);
  53. int dcp(void *);
  54. int dealloc(void *);
  55. int crtp(void *);
  56. int conv(void *);
  57. int chkparm(void *, void *);
  58. int check_end(unsigned int, void *);
  59. struct rqb *call_appl(void *);
  60. int buffmng(unsigned char, void *, void *, void *, unsigned, unsigned char, unsigned);
  61. unsigned long attltck(void *);
  62. unsigned long attacheck(void *);
  63. char *cgetmem(int, int);
  64. int sendhsf(void *);
  65. int opndst(void *);
  66. int alloc_rcb(void *, void *);
  67. int allocate(void *);
  68. int clsdst(void *);
  69.  
  70. obtsess(r_ptr, p)
  71. struct rcb *r_ptr;
  72. unsigned char p;
  73. {
  74.     struct gets gs;
  75.     struct sessa sa;
  76.     unsigned int code;
  77.     char p1;
  78.  
  79. #if OS_TYPE == 1
  80. /*********  Trace facility **********/
  81. unsigned int rtype;   /* type of record */
  82. unsigned int pnum;    /* point number */
  83. char pname[8];        /* name of module */
  84. char *drec;       /* record for dump */
  85. int  lenr;            /* record length */
  86.  
  87. rtype = INPROC;
  88. strcpy(pname, "obtsess");
  89. pnum = 1;
  90. drec = NULL;
  91. lenr = 0;
  92. gtf(rtype, pname, pnum, drec, lenr);
  93. /***********************************/
  94. #endif
  95.  
  96.     gs.p_tcb = r_ptr->p_tcb;
  97.     gs.p_rcb = r_ptr;
  98.     code = GET_SESSION;
  99.     psrm(code, &gs, &sa);
  100.  
  101.     switch (sa.rc) {
  102.         case OK : break; /* We ommiting the security info. */
  103.         case UNSUC_NO_RETRY :
  104.               {
  105.                 p1 = ALLOC_FAIL_NO_RETRY;
  106.                 fsm_error(p1,r_ptr);
  107.                 return (-1);
  108.               }
  109.         case SYNC_LEVEL_NOT_SUPPORTED :
  110.               {
  111.                 p1 = SYNC_LEVEL_NOT_SUPPORTED;
  112.                 fsm_error(p1,r_ptr);
  113.                 return (-2);
  114.               }
  115.     }
  116.     return(0);
  117. }
  118.  
  119.